<template>
  <!--  考公视图-->
  <!-- 将分类名和分类下的视频卡片信息通过props传给NormalModule组件 -->
  <!-- v-if 处理异步数据请求延迟问题，数据接收了再发送给子组件NormalModule -->
  <div v-for="(topic, index) in topicList" :key="index">
    <NormalModule :topic="topic" />
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive } from "vue";
import NormalModule from "@/components/normalModule/NormalModule.vue";
// import { videoApi } from "@/api/video";
// import { VideoList } from "@/api/model/video";

export default defineComponent({
  name: "ServantView",
  components: {
    NormalModule,
  },
  setup() {
    // const page = "servant";
    // 通过自定义类声明当前视图的接收回来的响应式数据
    const topicList = reactive(["国考", "省考"]);
    /* const videoList = reactive(new VideoList());
    videoApi
      .getVideoCardInfo({ page })
      .then((response: any) => {
        // data就是一个类目数组的对象
        videoList.videos = response.data.data;
      })
      .catch((error: any) => {
        console.log(error);
      }); */
    return {
      // videoList,
      topicList,
    };
  },
});
</script>

<style scoped>
</style>
